using System;
using System.Xml.Serialization;

namespace WeatherRouter.Model
{
	/// <summary>
	/// Summary description for Proxy.
	/// </summary>    
	public class Proxy
	{
        private string _address;
        private string _port;
		private Uri _endpoint;		
		private string _username;
		private string _password;
		private string _domain;
		private bool _enabled;
		private bool _authentication;

        public string Address
        {
            get { return _address; }
            set
            {
                _address = value;                
            }
        }

        public string Port
        {
            get { return _port; }
            set
            {
                _port = value;                
            }
        }

        [XmlIgnore]
		public Uri Endpoint
		{
			get
            {
                if (_endpoint == null)
                {                    
                    _endpoint = new Uri(_address + _port);    
                }
                return _endpoint;
            }
		}

		public string Username
		{
			get { return _username; }
			set { _username = value; }
		}

		public string Password
		{
			get { return _password; }
			set { _password = value; }
		}

		public string Domain
		{
			get { return _domain; }
			set { _domain = value; }
		}

		public bool Enabled
		{
			get { return _enabled; }
			set { _enabled = value;	}
		}

		public bool Authentication
		{
			get { return _authentication; }
			set { _authentication = value; }
		}
	}
}
